<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <table width="50%">
        <thead>
            <tr>
                <td>id</td>
                <td>name</td>
                <td>remark</td>
                <td>createdTime</td>
<!--                <td colspan="2">operation</td>-->
            </tr>
        </thead>
        <tbody id="tbody">
            <tr>
                <td colspan="2s">loding.........</td>
            </tr>
        </tbody>
    </table>
</body>
<script src="js/jquery.min.js"></script>
<script>
    window.onload = function(){
        let url="/goods/doFindGoods"
        $.getJSON(url,function(result){
            console.log(result);
            doHandleQueryResponseResult(result);
        })
    }
    function doHandleQueryResponseResult(result){
        //1.获取tbody对象并清空原有内容
        let tBody=$("tbody");//等效于document.querySelector("tbody");
        tBody.empty();//等效于innerHTML="";
        //2.迭代result并将其内容追加到tbody中
        result.forEach(function(item){
            tBody.append(`<tr>
                            <td>${item.id}</td>
                            <td>${item.name}</td>
                            <td>${item.remark}</td>
                            <td>${item.createdTime}</td>
                            <tr>`);
        })
    }
</script>
</html>